//
//  ThirdViewController.m
//  UI7_UINavigationController
//
//  Created by TravelRound on 15/11/17.
//  Copyright © 2015年 TravelRound. All rights reserved.
//

#import "ThirdViewController.h"
#import "FourthViewController.h"

@interface ThirdViewController ()

@end

@implementation ThirdViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor blueColor];
    self.navigationItem.title = @"QQ";
    
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"下一页" style:UIBarButtonItemStylePlain target:self action:@selector(rightAction:)] autorelease];
    
    self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"返回第一页" style:UIBarButtonItemStylePlain target:self action:@selector(leftAction:)] autorelease];
    
}

- (void)leftAction:(UIBarButtonItem *)sender
{
    
    [self.navigationController popToRootViewControllerAnimated:YES];
    
}

- (void)rightAction:(UIBarButtonItem *)sender
{
    
    FourthViewController *fourthVC = [[FourthViewController alloc] init];
    
    [self.navigationController pushViewController:fourthVC animated:YES];
    
    [fourthVC release];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
